package vn.ttpcode.com.sample.videoview;


import android.content.Context;
import android.util.AttributeSet;
import android.util.Log;
import android.widget.MediaController;

public class MyMediaController extends MediaController{
	
	private static final String TAG = "ttpcode";
	private static final String SUB_TAB = "MyMediaController => ";
	private static final int TIMEOUT = 3000;
	private Context mContext;
	private MediaCtrListener impl;
	
	public MyMediaController(Context context, AttributeSet attrs) {
		super(context, attrs);
		// TODO Auto-generated constructor stub
		mContext = context;
	}
	public MyMediaController(Context context) {
		super(context);
		// TODO Auto-generated constructor stub
		mContext = context;
	}
	
	@Override
	public void show(int timeout) {
		// TODO Auto-generated method stub
		super.show(TIMEOUT);
	}
	
	@Override
	public void show() {
		// TODO Auto-generated method stub
		super.show();
		Log.e(TAG, SUB_TAB + "====== SHOW ======");
		impl.doStatus(true);
	}
	
	@Override
	public void hide() {
		// TODO Auto-generated method stub
		super.hide();
		Log.e(TAG, SUB_TAB + "====== HIDE ======");
		impl.doStatus(false);
	}
	
	@Override
	public void onFinishInflate() {
		// TODO Auto-generated method stub
		super.onFinishInflate();
		Log.e(TAG, SUB_TAB + "onFinishInflate");
	}
	
	
	/**
	 * @param progress the progress to set
	 */
	public void setImplements(MediaCtrListener impl) {
		this.impl = impl;
	}
	/**
	 * Create progress listener interface
	 */
	public interface MediaCtrListener{
		public void doStatus(boolean isShow);
	}
}
